package com.glsc.ngateway.platform.domain.costallocation;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @author guoj
 * @description: 应用类别
 * @date 2024/8/6 9:02
 */
@Data
@Entity
@Table(name = "t_system_component_category")
@AllArgsConstructor
@NoArgsConstructor
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
public class SystemComponentCategory {
    @ApiModelProperty(value = "ID")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "l_id", columnDefinition = "int(11) comment '系统ID'")
    private Long id;

    @ApiModelProperty(value = "系统信息ID")
    @Column(name = "vc_systeminfo_id", columnDefinition = "varchar(10) comment '系统信息ID'")
    private Long systemInfoId;

    @ApiModelProperty(value = "应用类别")
    @Column(name = "vc_component_category", columnDefinition = "varchar(50) comment '应用类别'")
    private String componentCategory;
    @ApiModelProperty(value = "默认安装路径")
    @Column(name = "vc_default_path", columnDefinition = "varchar(100) comment '默认安装路径'")
    private String defaultPath;

    @ApiModelProperty(value = "操作人")
    @Column(name = "vc_operator",columnDefinition = "varchar(30) comment '操作人'")
    private String operator;

    @ApiModelProperty(value = "更新时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @org.hibernate.annotations.UpdateTimestamp
    @Column(name = "dt_update_time", columnDefinition = "datetime comment '更新时间'")
    protected LocalDateTime updateTime;

    @ApiModelProperty(value = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @Column(name = "dt_create_time", columnDefinition = "datetime comment '创建时间'")
    protected LocalDateTime createTime;
}
